package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.YouxuanProductSaleDetail;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.YouxuanOrderMapper;
import com.ruoyi.system.domain.YouxuanOrder;
import com.ruoyi.system.service.IYouxuanOrderService;

/**
 * 订单管理Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-02-04
 */
@Service
@DataSource(DataSourceType.SLAVE)
public class YouxuanOrderServiceImpl implements IYouxuanOrderService 
{
    @Autowired
    private YouxuanOrderMapper youxuanOrderMapper;

    /**
     * 查询订单管理
     * 
     * @param orderId 订单管理ID
     * @return 订单管理
     */
    @Override
    public YouxuanOrder selectYouxuanOrderById(String orderId)
    {
        return youxuanOrderMapper.selectYouxuanOrderById(orderId);
    }

    /**
     * 查询订单管理列表
     * 
     * @param youxuanOrder 订单管理
     * @return 订单管理
     */
    @Override
    public List<YouxuanOrder> selectYouxuanOrderList(YouxuanOrder youxuanOrder)
    {
        return youxuanOrderMapper.selectYouxuanOrderList(youxuanOrder);
    }

    @Override
    public List<YouxuanProductSaleDetail> selectYouxuanProductSaleDetailList(YouxuanProductSaleDetail youxuanProductSaleDetail) {
        return youxuanOrderMapper.selectYouxuanProductSaleDetailList(youxuanProductSaleDetail);
    }

    /**
     * 新增订单管理
     * 
     * @param youxuanOrder 订单管理
     * @return 结果
     */
    @Override
    public int insertYouxuanOrder(YouxuanOrder youxuanOrder)
    {
        youxuanOrder.setCreateTime(DateUtils.getNowDate());
        return youxuanOrderMapper.insertYouxuanOrder(youxuanOrder);
    }

    /**
     * 修改订单管理
     * 
     * @param youxuanOrder 订单管理
     * @return 结果
     */
    @Override
    public int updateYouxuanOrder(YouxuanOrder youxuanOrder)
    {
        return youxuanOrderMapper.updateYouxuanOrder(youxuanOrder);
    }

    /**
     * 批量删除订单管理
     * 
     * @param orderIds 需要删除的订单管理ID
     * @return 结果
     */
    @Override
    public int deleteYouxuanOrderByIds(String[] orderIds)
    {
        return youxuanOrderMapper.deleteYouxuanOrderByIds(orderIds);
    }

    /**
     * 删除订单管理信息
     * 
     * @param orderId 订单管理ID
     * @return 结果
     */
    @Override
    public int deleteYouxuanOrderById(String orderId)
    {
        return youxuanOrderMapper.deleteYouxuanOrderById(orderId);
    }
}
